package com.ldl.servlet.admin;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ldl.service.LdlArticleService;
import com.ldl.service.impl.LdlArticleServiceImpl;
import com.ldl.vo.LdlArticleVO;

/**
 * @author Administrator
 * Author : L.D.L
 * E-mail : 1419485293@qq.com
 * Date : 2020年7月25日下午4:14:12
 */
//@WebServlet("/admin/news-list.let")
public class NewsListServlet extends HttpServlet{

	private LdlArticleService articleService = new LdlArticleServiceImpl();
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int len = 10;
		try{
			len = Integer.valueOf(request.getParameter("len"));
		}catch(Exception ex){
			
		}
		
		List<LdlArticleVO> list = articleService.list(len);
		request.setAttribute("list", list);
		request.getRequestDispatcher("/admin/news-list.jsp").forward(request, response);
		
	}
}
